package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;

import java.util.Random;

public class progressBarActivity extends AppCompatActivity{
    ProgressBar progressBar;
    Button btnSet;
    int value = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progress_bar);

        progressBar = findViewById(R.id.progressBar);

        btnSet = findViewById(R.id.btnSet);

        progressBar.setProgress(value);
        btnSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Random random = new Random();
                Log.v("ran:", ""+random.nextInt(10));
                value = value + random.nextInt( 10);
                progressBar.setProgress(value);
            }
        });

    }




}
